﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="RC_Catalogs.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.RC_Catalogs" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  
 
  <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>

   <script type="text/javascript">
       function openProjectDetails(id) 
       {
           radopen("RC_CatalogDtls.aspx?ParentSeq=" + id, "ProjectDtls");
           return false;
       }
       function openReport() {
           radopen("RPT_Exports.aspx?ReportName=RPT_CMD_Headers", "ProjectDtls");
       }
       function onTextChange(sender) {
           if (sender.get_value() == "") {
               sender.set_text("");
           }
       } 
   </script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="CrystalReportViewer1" LoadingPanelID="RadAjaxLoadingPanel2" /> 
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        VisibleStatusbar="false"
        title="บัญชีรายชื่อ"
        width="1000px"
        Height="520px"        
        Modal="true"
        Skin = "Vista"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>

</telerik:RadWindowManager>
    
    <title></title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
    
    <asp:panel ID="Panel6" runat="server" >
    <table width="1000" cellpadding="0" cellspacing="0">
    <tr>
            
    <td>
            
    <div class="moduleDivSlim1000">
    <div class="moduleDivBottom1000">
     <asp:Panel ID="PanelFilter" runat="server" Width="1000px" ScrollBars="Auto">
        <table align = "center" width = "980px">
        <tr>
            <td align="right" >ประเภทบุคลากร :</td>
            <td align="left" >                
                <telerik:RadComboBox ID="cmbEmployeeType" runat="server" 
                    AllowCustomText="true" 
                    AutoPostBack = "true"
                    CausesValidation="false" 
                    DataTextField="Name" 
                    DataValueField="Sequence" 
                    EmptyMessage="... เลือกประเภทบุคลากร ..." Filter="Contains" 
                    OnClientTextChange="onTextChange" Width="200px"                                        
                    onselectedindexchanged="cmbEmployeeType_SelectedIndexChanged">
                </telerik:RadComboBox>
                <asp:RequiredFieldValidator ID="v7" runat="server" 
                    ControlToValidate="cmbEmployeeType" ErrorMessage="*">
                </asp:RequiredFieldValidator>
            </td>
            <td align="right" > ปีงบประมาณ :</td>
            <td align="left" >
               
                <telerik:RadComboBox ID="cmbYear" runat="server" 
                    AllowCustomText="true" 
                    AutoPostBack = "true"
                    CausesValidation="false" 
                    DataTextField="Name" 
                    DataValueField="Name" 
                    EmptyMessage="...เลือกปีงบประมาณ ..." 
                    Filter="Contains" 
                    OnClientTextChange="onTextChange" 
                    Width="200px" 
                    onselectedindexchanged="cmbYear_SelectedIndexChanged" >
                </telerik:RadComboBox>
            </td>
            <td align="left" >
            </td>
        </tr>
    </table>
    </asp:Panel>
</div>
</div>

    </td>
    
  </tr>
  </table>
          

      <td>

      </td>
      
      <tr>
      <td colspan = "3">
    <div class="moduleDivSlim1000x450">
    <div class="moduleDivBottom1000">

        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
                บัญชีรายชื่อ</td>
        </tr>
        </table>
        <table width ="980px" align = "center" >
        <tr>
        <td >
        <asp:Panel ID="PanelGrid" runat="server" width ="970px" Height="400px" ScrollBars="Auto" >
            <telerik:RadGrid ID="RadGrid2" runat="server" 
                AllowFilteringByColumn="True" 
                AllowAutomaticDeletes="True"
                AllowMultiRowEdit="True" 
                AllowMultiRowSelection="True" AllowPaging="True" 
                AllowSorting="True" 
                AutoGenerateColumns="False" EnableAJAX="True" 
                EnableAJAXLoadingTemplate="True" GridLines="None" 
                OnItemCommand="RadGrid2_ItemCommand" 
                Skin="Outlook" width ="950px"
                GroupingSettings-GroupByFieldsSeparator = "&nbsp;&nbsp;&nbsp;&nbsp;"
                GroupingSettings-GroupContinuedFormatString = ""
                GroupingSettings-GroupContinuesFormatString = ""
                GroupingSettings-GroupSplitFormat = "">
                <MasterTableView 
                    AllowMultiColumnSorting="True" 
                    CellSpacing="-1" 
                    ClientDataKeyNames="cat_seq" 
                    CommandItemDisplay="Top" 
                    DataKeyNames="cat_seq" 
                    InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                    NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                    <CommandItemTemplate>
                        <table width="100%">
                            <tr>
                                <td>
                                    <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                        CommandName="InitInsert" 
                                        Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>"> <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                        style="border: 0px; vertical-align: middle;" /> จัดทำบัญชีรายชื่อ</asp:LinkButton>
                                    &nbsp;&nbsp;
                                </td>
                                <td align="right">
                                </td>
                            </tr>
                        </table>
                    </CommandItemTemplate>
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>

                    <ExpandCollapseColumn Visible="True">
                    </ExpandCollapseColumn>             
                        
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                            EditText="คลิกเพื่อแก้ไขข้อมูล">
                            <HeaderStyle HorizontalAlign="Center" Width="5%" />
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                        </telerik:GridEditCommandColumn>                      
                   
                        <telerik:GridButtonColumn ButtonType="ImageButton" 
                            CommandName="Delete" 
                            ConfirmDialogType="RadWindow" 
                            ConfirmText="ลบข้อมูลที่เลือก?" 
                            Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                            <HeaderStyle HorizontalAlign="Center" Width="5%" />
                            <ItemStyle HorizontalAlign="Center" Width="5%" />
                        </telerik:GridButtonColumn>
                        <telerik:GridBoundColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="bg_year" 
                            FilterControlWidth="100%" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderText="ปีงบประมาณ" 
                            ItemStyle-HorizontalAlign = "Center"
                            UniqueName = "bg_year">
                            <HeaderStyle HorizontalAlign="Center" Width="100px" />                     
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="cat_period" 
                            FilterControlWidth="100%" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderText="ครั้งที่"
                            ItemStyle-HorizontalAlign = "Center" 
                            UniqueName = "cat_period">
                            <HeaderStyle HorizontalAlign="Center" Width="50" />               
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="cat_name" 
                            FilterControlWidth="100%" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderStyle-Width = "300px"
                            HeaderText="เรื่อง" >              
                            <ItemTemplate>   
                                <asp:LinkButton ID="targetControl" runat="server" 
                                    Text='<%# Eval("cat_name") %>' 
                                    OnClientClick='<%# string.Format("return openProjectDetails(\"{0}\");", Eval("cat_seq")) %>'>
                                </asp:LinkButton>           
                            </ItemTemplate>               
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="app_total" 
                            FilterControlWidth="100%"         
                            HeaderText="จำนวนรายชื่อ"
                            ItemStyle-HorizontalAlign = "Center" 
                            UniqueName = "app_total">
                            <HeaderStyle HorizontalAlign="Center" Width="50" />               
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="emp_total" 
                            FilterControlWidth="100%"  
                            HeaderText="จำนวนที่บรรจุแล้ว"
                            ItemStyle-HorizontalAlign = "Center" 
                            UniqueName = "emp_total">
                            <HeaderStyle HorizontalAlign="Center" Width="50" />               
                        </telerik:GridBoundColumn>                        
                         <telerik:GridBoundColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="remarks" 
                            FilterControlWidth="100%" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderText="หมายเหตุ" 
                            UniqueName = "remarks">
                            <HeaderStyle HorizontalAlign="Center" Width="100" />               
                        </telerik:GridBoundColumn> 
      
            <telerik:GridTemplateColumn 
                    AllowFiltering = "false"
                    HeaderStyle-HorizontalAlign="Center" 
                    HeaderStyle-Width = "50px"
                    ItemStyle-Width = "50px"
                    ItemStyle-HorizontalAlign = "Center"
                    HeaderText="พิมพ์" >           
                    <ItemTemplate>              
                        <asp:LinkButton ID="cmdPrint" runat="server" CommandName = "PrintPreview" >
                            <img style="border:0px;vertical-align:middle;" alt="พิมพ์รายชื่อ" 
                                src="../Images/Buttons/Print1.gif" />
                        </asp:LinkButton>
                    </ItemTemplate>               
                </telerik:GridTemplateColumn>           

            </Columns>                         
            <EditFormSettings EditFormType="WebUserControl"  
                UserControlName="../UserControls/RC_Catalogs.ascx">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            </MasterTableView>
            <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </asp:Panel>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>

</asp:panel>
</asp:Content>
